Skip to content

Assertion JiT integration - #2223

Open
rafal-hawrylak wants to merge 3 commits into
mainfrom
assertion-jit-integration
Open

Assertion JiT integration#2223
rafal-hawrylak wants to merge 3 commits into
mainfrom
assertion-jit-integration

Conversation

@rafal-hawrylak

Copy link
Copy Markdown
Collaborator

Assertion actions were not integrated into the JiT compilation runtime, even though the compiler (core/jit_compiler.ts) already supports them. Two gaps in Runner:

  • compileJitAction had no branch for action.type === "assertion", so assertions fell through to JIT_COMPILATION_TARGET_TYPE_UNSPECIFIED and the compiler rejected the request.
  • createTasksFromJitResponse had no branch for jitResponse.assertion, so even a successful compile produced zero tasks and the action silently did nothing.

This PR wires both - assertions with jitCode now compile through the JiT worker and produce the same task set as their AoT counterparts (via executionSql.createAssertionTasks).

@rafal-hawrylak
rafal-hawrylak requested a review from a team as a code owner July 15, 2026 14:11
@rafal-hawrylak
rafal-hawrylak requested review from krushangSk17 and removed request for a team July 15, 2026 14:11
@ikholopov-omni

Copy link
Copy Markdown
Collaborator

Is this PR rebased onto any other PRs?

If yes - please send to review after those are merged.

@rafal-hawrylak
rafal-hawrylak force-pushed the assertion-jit-integration branch 3 times, most recently from 5efa010 to 2708c15 Compare July 16, 2026 07:34
@rafal-hawrylak
rafal-hawrylak force-pushed the assertion-jit-integration branch from 2708c15 to 88a88c7 Compare July 22, 2026 20:08
Runs 4 JiT actions and asserts the CANCEL_EVENT listener count returns
to zero after the run completes. Fails today (leaks 4 listeners) — will
pass once run.ts unregisters each per-compile cancel handler.
Runner.compileJitAction was missing an assertion branch in the
target-type selector, so assertions fell through to
JIT_COMPILATION_TARGET_TYPE_UNSPECIFIED and the compiler rejected
them. createTasksFromJitResponse also had no branch for
jitResponse.assertion, so the compiled query never reached
executionSql.createAssertionTasks.

Wire both: select ASSERTION for assertion actions, and hydrate a
dataform.Assertion from the JiT response before building tasks.

Tests:
 - Runner-level unit test (jit_run_test.ts) drives a single JiT
   assertion action end-to-end and checks the resulting task set.
 - CLI e2e test (index_jit_runtime_test.ts) uses assert().jitCode()
   against dry-run BigQuery.
@rafal-hawrylak
rafal-hawrylak force-pushed the assertion-jit-integration branch from 88a88c7 to 160c6a7 Compare August 5, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants